package com.qaml.mes.device.enums;

import java.util.Arrays;

/**
 * @ClassName OrderStatusEnum
 * @Description  任务单主状态
 * @Author leikai
 * @Date 2023/10/23 9:54
 * @Version 1.0
 */
public enum MesEqpOrderStatusEnum {
    CANCELED(-1, "已取消"),
    NO_START(0, "未开始"),
    HANDLING(10, "处理中"),
    COMPLETED(20, "已完成");


    private Integer type;

    private String desc;


    MesEqpOrderStatusEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static MesEqpOrderStatusEnum ofType(Integer type) {
        if (null == type) {
            return null;
        }
        return Arrays.stream(values()).filter(mesEqpOrderStatusEnum -> mesEqpOrderStatusEnum.getType().equals(type)).findFirst().orElse(null);
    }
}
